/** 配送记录 */
export interface DeliveryRecordItem {
  id: string
  date: string
  shopName: string
  shopId?: string
  area: string
  preparationTime: number
  deliveryTime: number
  totalTime: number
  difficulty: number
  notes?: string
  createdAt?: string
  updatedAt?: string
}

/** 配送区域信息 */
export interface DeliveryAreaItem {
  id: string
  name: string
  district: string
  difficulty: number
  avgDeliveryTime: number
  totalDeliveries?: number
  notes?: string
}

/** 获取配送记录请求参数 */
export interface GetDeliveryRecordsRequestData {
  page?: number
  pageSize?: number
  startDate?: string
  endDate?: string
  shopName?: string
  area?: string
  sortBy?: string
  sortOrder?: 'asc' | 'desc'
}

/** 获取配送记录响应数据 */
export interface GetDeliveryRecordsResponseData {
  list: DeliveryRecordItem[]
  total: number
  page: number
  pageSize: number
}

/** 创建配送记录请求数据 */
export interface CreateDeliveryRecordRequestData {
  date: string
  shopName: string
  shopId?: string
  area: string
  preparationTime: number
  deliveryTime: number
  difficulty: number
  notes?: string
}

/** 更新配送记录请求数据 */
export interface UpdateDeliveryRecordRequestData {
  date?: string
  shopName?: string
  shopId?: string
  area?: string
  preparationTime?: number
  deliveryTime?: number
  difficulty?: number
  notes?: string
}

/** 配送统计数据 */
export interface DeliveryStatsData {
  totalRecords: number
  avgPreparationTime: number
  avgDeliveryTime: number
  avgTotalTime: number
  fastShopsCount: number
  slowShopsCount: number
  easyAreasCount: number
  hardAreasCount: number
  dailyStats: Array<{
    date: string
    avgPreparationTime: number
    avgDeliveryTime: number
    avgTotalTime: number
    recordCount: number
  }>
}

/** 获取配送区域请求参数 */
export interface GetDeliveryAreasRequestData {
  page?: number
  pageSize?: number
  district?: string
  difficulty?: number
  sortBy?: string
  sortOrder?: 'asc' | 'desc'
}

/** 获取配送区域响应数据 */
export interface GetDeliveryAreasResponseData {
  list: DeliveryAreaItem[]
  total: number
  page: number
  pageSize: number
}

/** 创建配送区域请求数据 */
export interface CreateDeliveryAreaRequestData {
  name: string
  district: string
  difficulty: number
  avgDeliveryTime: number
  notes?: string
}

/** 更新配送区域请求数据 */
export interface UpdateDeliveryAreaRequestData {
  name?: string
  district?: string
  difficulty?: number
  avgDeliveryTime?: number
  notes?: string
}